<template>
  <el-collapse v-model="activeNames">
    <el-collapse-item name="基本配置">
      <template slot="title">
        <div class="title">
          <i class="iconfont icon-peizhi"></i>
          <span>基本配置</span>
        </div>
      </template>
      <el-form class="config" label-position="top">
        <el-form-item label="组件名称">
          <el-input :value="selectWidget.name" disabled></el-input>
        </el-form-item>
        <el-form-item label="按钮名称">
          <el-input v-model="selectWidgetBase.buttonName"></el-input>
        </el-form-item>
        <el-form-item label="尺寸">
          <el-radio-group v-model="selectWidgetBase.buttonSize">
            <el-radio-button label="medium">中等</el-radio-button>
            <el-radio-button label="small">偏小</el-radio-button>
            <el-radio-button label="mini">迷你</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="按钮类型">
          <el-select v-model="selectWidgetBase.buttonType" placeholder="请选择">
            <el-option
              v-for="item in btTypes"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="按钮图标">
          <el-input v-model="selectWidgetBase.buttonIcon"> </el-input>
        </el-form-item>
        <el-form-item label="朴素按钮">
          <el-switch
            v-model="selectWidgetBase.buttonPlain"
            :active-value="true"
            :inactive-value="false"
          >
          </el-switch>
        </el-form-item>
        <el-form-item label="圆角按钮">
          <el-switch
            v-model="selectWidgetBase.buttonRound"
            :active-value="true"
            :inactive-value="false"
          >
          </el-switch>
        </el-form-item>
        <el-form-item label="圆形按钮">
          <el-switch
            v-model="selectWidgetBase.buttonCircle"
            :active-value="true"
            :inactive-value="false"
          >
          </el-switch>
        </el-form-item>
        <el-form-item label="操作类型">
          <el-select v-model="selectWidgetBase.optType" placeholder="请选择">
            <el-option
              v-for="item in optTypes"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item v-if="selectWidgetBase.optType === 1" label="链接地址">
          <el-input v-model="selectWidgetData.openUrl"></el-input>
        </el-form-item>
        <el-form-item label="自定义样式">
          <el-input v-model="selectWidgetBase.style" type="textarea"></el-input>
        </el-form-item>
      </el-form>
    </el-collapse-item>
  </el-collapse>
</template>

<script>
import widget from '@/mixins/widget'

export default {
  mixins: [widget],
  data() {
    return {
      activeNames: '基本配置',
      btTypes: [
        {
          label: '正常',
          value: 'primary'
        },
        {
          label: '成功',
          value: 'success'
        },
        {
          label: '警告',
          value: 'warning'
        },
        {
          label: '危险',
          value: 'danger'
        },
        {
          label: '信息',
          value: 'info'
        },
        {
          label: '文本',
          value: 'text'
        }
      ],
      optTypes: [
        {
          label: '默认',
          value: 0
        },
        {
          label: '打开链接',
          value: 1
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped></style>
